Not delete params in URL, when sorting [ RAILS 3 ]

Posted by kamil on Stack Overflow See other posts from Stack Overflow or by kamil
Published on 2011-01-17T10:51:27Z Indexed on 2011/01/17 10:53 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

I have sortable table columns, made like that http://asciicasts.com/episodes/228-sortable-table-columns And I have simply filter options for two columns in table, made at select_tag (GET method).

This two function don't work together. When I change filter, the sort parameter disappear and inversely.

<th><%= sortable "Id" %></th>
<th>
  Status<br/>
  <form method="get">
  <%= select_tag(:status, options_for_select([['All', 'all']]+@statuses, params[:status]),{:onchange => 'this.form.submit()'}) %> 
</th>
<th><%= sortable "Operation" %></th>
<th>
  Processor<br/>
  <%= select_tag(:processor, options_for_select([['All', 'all']]+@processor_names, params[:processor]),{:onchange => 'this.form.submit()'}) %>
  </form> 
</th>

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about sorting